Skip to content

Conversation

albertzaharovits
Copy link
Contributor

@albertzaharovits albertzaharovits commented Apr 1, 2025

The intent here is to aim for fewer to-do merges enqueued for execution,
and to unthrottle disk IO at a faster rate when the queue grows longer.
Overall this results in less merge disk throttling.

Relates https://github.com/elastic/elasticsearch-benchmarks/issues/2437 #120869

@albertzaharovits albertzaharovits added >non-issue :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. v9.1.0 labels Apr 1, 2025
@albertzaharovits albertzaharovits self-assigned this Apr 1, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Indexing Meta label for Distributed Indexing team label Apr 1, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing)

Copy link
Contributor

@henningandersen henningandersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments.

Also, I were expecting some sort of test change to be necessary. But if not, perhaps we can add a test to show that only the first task submitted decreases the io-rate?

this.maxConcurrentMerges = threadPool.info(ThreadPool.Names.MERGE).getMax();
this.concurrentMergesFloorLimitForThrottling = maxConcurrentMerges * 2;
this.concurrentMergesCeilLimitForThrottling = maxConcurrentMerges * 4;
this.concurrentMergesFloorLimitForThrottling = 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put a comment here that this means to only decrease throttle rate when we submit a task and no other tasks are running?

this.concurrentMergesCeilLimitForThrottling = maxConcurrentMerges * 4;
this.concurrentMergesFloorLimitForThrottling = 2;
this.concurrentMergesCeilLimitForThrottling = maxConcurrentMerges * 2;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps assert that concurrentMergesCeilLimitForThrottling >= concurrentMergesFloorLimitForThrottling - I feel like it adds readabililty.

newTargetIORateBytesPerSec = Math.min(
MAX_IO_RATE.getBytes(),
currentTargetIORateBytesPerSec + currentTargetIORateBytesPerSec / 10L
currentTargetIORateBytesPerSec + currentTargetIORateBytesPerSec / 20L
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what you did only adds 5%, it should be:

Suggested change
currentTargetIORateBytesPerSec + currentTargetIORateBytesPerSec / 20L
currentTargetIORateBytesPerSec + currentTargetIORateBytesPerSec / 5L

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this!

@albertzaharovits
Copy link
Contributor Author

Thanks for the review, @henningandersen , I've addressed it all, please take another look.

Copy link
Contributor

@henningandersen henningandersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@albertzaharovits albertzaharovits merged commit 1f0551a into elastic:main Apr 2, 2025
17 checks passed
andreidan pushed a commit to andreidan/elasticsearch that referenced this pull request Apr 9, 2025
The intent here is to aim for fewer to-do merges enqueued for execution,
and to unthrottle disk IO at a faster rate when the queue grows longer.
Overall this results in less merge disk throttling.

Relates elastic/elasticsearch-benchmarks#2437 elastic#120869
albertzaharovits added a commit to albertzaharovits/elasticsearch that referenced this pull request Jun 9, 2025
The intent here is to aim for fewer to-do merges enqueued for execution,
and to unthrottle disk IO at a faster rate when the queue grows longer.
Overall this results in less merge disk throttling.

Relates elastic/elasticsearch-benchmarks#2437 elastic#120869
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. >non-issue Team:Distributed Indexing Meta label for Distributed Indexing team v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants